import sys

all_teams = []

def read_teams(self):
	f = open('all-teams.csv','r')
	all_teams = f.readlines()
	f.close()	

	return 1	

def test_file(self,filename):
	f = open(filename,'r')
	lines = f.readlines()

	for line in lines:
		fields = line.split(',')
		if (fields[0] == '#'): continue
		name1 = fields[1]
		name2 = fields[2]
		assert name1 in all_teams, "Winner not correct" % str(name1)
		assert name2 in all_teams, "Loser not correct" % str(name2)

	f.close()
	return 1

if __name__ == "__main__":
	test_file('results2008.csv')
		
